/*    */ package com.zimbra.cs.redolog.op;
/*    */ 
/*    */ import com.zimbra.cs.mailbox.MailboxOperation;
/*    */ import com.zimbra.cs.redolog.RedoLogInput;
/*    */ import com.zimbra.cs.redolog.RedoLogOutput;
/*    */ import com.zimbra.cs.volume.VolumeManager;
/*    */ import com.zimbra.cs.volume.VolumeServiceException;
/*    */ import java.io.IOException;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public final class DeleteVolume
/*    */   extends RedoableOp
/*    */ {
/*    */   private short mId;
/*    */   
/*    */   public DeleteVolume()
/*    */   {
/* 33 */     super(MailboxOperation.DeleteVolume);
/*    */   }
/*    */   
/*    */   public DeleteVolume(short id) {
/* 37 */     this();
/* 38 */     this.mId = id;
/*    */   }
/*    */   
/*    */   protected String getPrintableData()
/*    */   {
/* 43 */     StringBuffer sb = new StringBuffer("id=").append(this.mId);
/* 44 */     return sb.toString();
/*    */   }
/*    */   
/*    */   protected void serializeData(RedoLogOutput out) throws IOException
/*    */   {
/* 49 */     out.writeShort(this.mId);
/*    */   }
/*    */   
/*    */   protected void deserializeData(RedoLogInput in) throws IOException
/*    */   {
/* 54 */     this.mId = in.readShort();
/*    */   }
/*    */   
/*    */   public void redo() throws Exception
/*    */   {
/* 59 */     VolumeManager mgr = VolumeManager.getInstance();
/*    */     try {
/* 61 */       mgr.getVolume(this.mId);
/* 62 */       mgr.delete(this.mId, getUnloggedReplay());
/*    */     } catch (VolumeServiceException e) {
/* 64 */       if (e.getCode() != "volume.NO_SUCH_VOLUME") {
/* 65 */         throw e;
/*    */       }
/*    */     }
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/redolog/op/DeleteVolume.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */